package com.daidai.activitys

import android.widget.FrameLayout
import com.daidai.base.BaseActivity
import com.daidai.custom.StyleView
import com.daidai.spinner.R

class TestStyleActivity: BaseActivity() {

    lateinit var flContainer:FrameLayout
    lateinit var view:StyleView

    override fun getContentViewResId() = R.layout.activity_style

    override fun initView() {
        flContainer = findViewById(R.id.flContainer)
        // case 1
        val view = StyleView(this,null,R.attr.customeViewTheme)
        flContainer.addView(view)

        // case 2
//        val outValue = TypedValue()
//        theme.resolveAttribute(R.attr.customeViewTheme,outValue,true)
//
//        if (outValue.resourceId != 0){
//            G.elog("method 1 called!......")
//            val wrapper = ContextThemeWrapper(this,outValue.resourceId)
//            view = StyleView(wrapper,null,R.attr.customeViewTheme)
//        }else{
//            G.elog("method 2 called!......")
//            view = StyleView(this,null,R.attr.customeViewStyle)
//        }
//        flContainer.addView(view)
    }

    override fun initData() {
    }
}